Skip to content

Conversation

sindrelm
Copy link
Member

@sindrelm sindrelm commented Apr 21, 2026 •

Refactor leaderboard to use class avarages

This PR refactors backend leaderboard api to return class avarages for all existing classes, instead of returning all pupil levels inside in a given class.

Changes

  • Add findAllWithAverageTotalScore() method to ClassroomRepository.kt
  • Refactor LeaderboardService.kt to use ClassroomRepository.kt instead of PupilGameProgressRespository.kt
  • Refactor API responses to adhere to the refactored LeaderboardService class
  • Add a leaderboard integration test.

Frontend

Preferably checkout "refactor/change-leaderboard-to-class-averages" on the frontend to get updated frontend leaderboard view.

Signed-off-by: sindrelm <sindrelm@stud.ntnu.no>
Signed-off-by: sindrelm <sindrelm@stud.ntnu.no>
Signed-off-by: sindrelm <sindrelm@stud.ntnu.no>
Signed-off-by: sindrelm <sindrelm@stud.ntnu.no>
Signed-off-by: sindrelm <sindrelm@stud.ntnu.no>
@sindrelm sindrelm marked this pull request as ready for review April 21, 2026 12:37
Copy link
Member

@eilifhl eilifhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@sindrelm sindrelm merged commit 61064c5 into main Apr 21, 2026
1 check passed
@sindrelm sindrelm deleted the refactor/change-leaderboard-to-class-averages branch April 21, 2026 12:55
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants